function idata = flexinterpn(data, coords, kernel, ksampling, hold, qtrf)
% flexinterp  - flexible data interpolation (up to 4D)
%
% FORMAT:       idata = flexinterpn(data, coords [, k, ks [, hold [, qt]]])
%
% Input fields:
%
%       data        up to 4D data
%       coords      CxD (number of coords -by- number of dims) coordinates
%               or  4xD range specification with
%                   1st row: Inf
%                   2nd row: from
%                   3rd row: step
%                   4th row: to, such that
%                   a given dim's range is sample at from:step:to
%       kernel      Kx1 interpolation kernel (e.g. from sinc(x)/sinc(x/a))
%       ksampling   kernel sampling
%       hold        default sample at invalid coordinates
%       qtrf        quaternion transformation applied to a given range
%
% Output fields:
%
%       idata       interpolated data
%
% Example:
%
%       data = randn(16, 16, 16);
%       kernel = sinc(-3:0.001:3) .* sinc(-1:1/3000:1);
%       kernel([1,end]) = 0;
%       meshing = 0.625:0.25:16.375;
%       [x, y, z] = meshgrid(meshing, meshing, meshing);
%       idata = reshape( ...
%           flexinterpn(data, [x(:), y(:), z(:)], kernel(:), 1000), ...
%           [64, 64, 64]);
%
% Observe that the sample result is obtained by using...
%
%       idata = flexinterpn(data, repmat([Inf; 0.625; 0.25; 16.375], 1, 3), ...
%           kernel(:), 1000);
%
% Note: This is a compiled function.

% Version:  v0.7f
% Build:    8110521
% Date:     Nov-05 2008, 9:00 PM CET
% Author:   Jochen Weber, SCAN Unit, Columbia University, NYC, NY, USA
% URL/Info: http://wiki.brainvoyager.com/BVQXtools

% bail out
error( ...
    'BVQXtools:MEXFileMissing', ...
    'This is a MEX compiled function, but the MEX file is missing.' ...
);
